function Wave(func, amplitude, frequency, phase) {
	this.Func = func;
	this.Amplitude = amplitude;
	this.Frequency = frequency;
	this.Phase = phase;
}

function Waves( ) {
	this.WaveCollection = new Array( );
}

Waves.prototype.Animate = function( ) {
	for (var i = 0; i < this.WaveCollection.length; i++) {
		this.WaveCollection[i].Animate( );	    
	}
}

Waves.prototype.Add = function(wave, color, offsetY) {
	// Don't forget that this is quadrant II, not quantrant III.
	wave.coord = new Coordinates(0, 0);
	wave.Color = color;
	wave.offsetY = offsetY;
	wave.Animate = function( ) {
			var t = wave.coord.X++;
			var y = translateY(this.Amplitude * this.Func(this.Frequency * t + this.Phase) + this.offsetY);
			canvas.PlotPixel(t, y, this.Color, 50, null);
	}

	this.WaveCollection.push(wave);
}


Waves.prototype.ResetAll = function(wave) {
	for (var i = 0; i < this.WaveCollection.length; i++) {
		this.WaveCollection[i].coord = new Coordinates(0, 0);
	}
}